{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Description\n",
    "\n",
    "Survival Analysis comprises of statistical approaches to analyze time to the underlying event of interest. The analysis may also be referred as reliability analysis. Here, we develop this package to understand the time series data of turbofan engines degradation simulations. The time series data contains hidden information that provides clues to the time to failure, also known as remaining useful life (RUL). Accurate estimation of RUL plays a critical role in health management of turbofan engines. This package preprocess and analyzes the data and develop a machine learning model to capture the hidden information such as interactions between multiple sensors measurements and degradation patterns. In this package, we propose Long Short-Term Memory (LSTM) approach for RUL estimation. LSTM models are based on neural network with cyclic connections that makes them powerful in modeling sequences and forecast the degradation patterns. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Table of Content\n",
    "\n",
    "  * [Data Description](#Data-Description)\n",
    "  * [Import Data](#Import-Data)\n",
    "      * [Data Analysis](#Data-Analysis)\n",
    "  * [Modeling Data Preparation](#Modeling-Data-Preparation)\n",
    "  * [Modelling](#Modelling)\n",
    "  * [Results & Discussion](#Results-&-Discussion)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Data Description\n",
    "\n",
    "NASA C-MAPSS (Commercial Modular Aero-Propulsion System Simulation) data set (Turbofan Engine Degradation Simulation Data Set) is a widely used benchmark data. C-MAPSS data includes sensor data with different number of operating conditions and fault conditions [1].\n",
    "\n",
    "|      Data Set        |  FD001 | FD002 | FD003 | FD004|\n",
    "|----------------------|--------|-------|-------|------|\n",
    "|  Train Trajectories  |  100   |  260  |  100  | 249  |\n",
    "|   Test Trajectories  |  100   |  259  |  100  |  248 |\n",
    "| Operating Conditions |    1   |   6   |   1   |   6  |\n",
    "|    Fault Conditions  |    1   |   1   |   2   |   2  |\n",
    "\n",
    "The data has 4 sub-data sets with different number of operating conditions and fault conditions and each sub-data set is further divided into training and test subsets, as shown in table above. We use dataset FD002 for our purpose. Each row in the data is a snapshot of data taken during a single operating time cycle, which includes 26 columns: \n",
    " * 1st column represents engine ID, \n",
    " * 2nd column represents the current operational cycle number, \n",
    " * 3-5 columns are the three operational settings that have a substantial effect on engine performance, \n",
    " * 6-26 columns represent the 21 sensor values. More information about the 21 sensors can be found in [2]. \n",
    "\n",
    "The engine is operating normally at the start of each time series, and develops a fault at some point in time which is unknown. In the training set, the fault grows in magnitude until a system failure. In the test set, data is provided up to some time prior to system failure. The goal is to estimate the number of remaining operational cycles before failure on the test data. \n",
    "\n",
    "[1] S. Zheng, K. Ristovski, A. Farahat and C. Gupta, \"Long Short-Term Memory Network for Remaining Useful Life estimation,\" 2017 IEEE International Conference on Prognostics and Health Management (ICPHM), Dallas, TX, 2017, pp. 88-95.\n",
    "\n",
    "[2] E. Ramasso and A. Saxena, “Performance benchmarking and analysis of prognostic methods for cmapss datasets.” International Journal of Prognostics and Health Management, vol. 5, no. 2, pp. 1–15, 2014."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Import Data\n",
    "\n",
    "'Turbofan Engine Degradation Simulation Data Set' can be downloaded from here: \n",
    "https://ti.arc.nasa.gov/tech/dash/pcoe/prognostic-data-repository/"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "No module named LSTM.data_import",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-1-26cb76e8e204>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;31m# Import C-MAPSS Dataset FD002 train and test and records of RUL\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mLSTM\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdata_import\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mget_C_MAPSS_Data\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0mdata_training_FD2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata_testing_FD2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdata_testing_RUL_FD2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_C_MAPSS_Data\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mImportError\u001b[0m: No module named LSTM.data_import"
     ]
    }
   ],
   "source": [
    "# Import C-MAPSS Dataset FD002 train and test and records of RUL\n",
    "from LSTM.data_import import get_C_MAPSS_Data\n",
    "data_training_FD2, data_testing_FD2, data_testing_RUL_FD2 = get_C_MAPSS_Data()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
